package 链表和树.链表;
//Java：删除链表中的节点
public class DeleteNodeInALinkedList{
    public static void main(String[] args) {
        Solution solution = new DeleteNodeInALinkedList().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)


//  public class ListNode {
//     int val;
//    ListNode next;
//     ListNode(int x) { val = x; }
//  }
class Solution {
    public void deleteNode(ListNode node) {
        //给定节点的值不存在链表中就删除了
        node.val = node.next.val;
        node.next = node.next.next;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}